#ifndef GROUNDWEATHERSTATIONDISPLAYFORM_H
#define GROUNDWEATHERSTATIONDISPLAYFORM_H

#include <QWidget>
#include <QChart>

#include "../../protocol/groundweatherstationprotocol.h"

namespace Ui {
class GroundWeatherStationDisplayForm;
}

class GroundWeatherStationDisplayForm : public QWidget
{
    Q_OBJECT

public:
    explicit GroundWeatherStationDisplayForm(QWidget *parent = nullptr);
    ~GroundWeatherStationDisplayForm();

signals:
    //由于有六个chart需要更新，因此通过一个同一的信号进行通知更新更合适，将具体的更新操作放在了init_chart函数中，在init_chart中连接此信号和更新chart的lambda函数
    void sig_updateChats(protocol::GroundWeatherStationProtocol);

private slots:


private:
    Ui::GroundWeatherStationDisplayForm *ui;
    QChart *m_chart_Temperature;
    QChart *m_chart_Humidity;
    QChart *m_chart_Pressure;
    QChart *m_chart_Rain;
    QChart *m_chart_WindSpeed;
    QChart *m_chart_WindDirection;

    //维护所有的
    QVector<int> m_yAxis_humidity_Max;
    QVector<int> m_yAxis_humidity_Min;
    QVector<int> m_yAxis_temperature_Max;
    QVector<int> m_yAxis_temperature_Min;
    QVector<int> m_yAxis_pressure_Max;
    QVector<int> m_yAxis_pressure_Min;
    QVector<int> m_yAxis_rain_Max;
    QVector<int> m_yAxis_rain_Min;
    QVector<int> m_yAxis_windSpeed_Max;
    QVector<int> m_yAxis_windSpeed_Min;
    QVector<int> m_yAxis_windDirection_Max;
    QVector<int> m_yAxis_windDirection_Min;



    void InitChart_Temperature();
    void InitChart_Humidity();
    void InitChart_Pressure();
    void InitChart_Rain();
    void InitChart_WindSpeed();
    void InitChart_WindDirection();

    void InitDataLabel();
};

#endif // GROUNDWEATHERSTATIONDISPLAYFORM_H
